﻿<%@ Page Title="" Language="C#" MasterPageFile="~/View/MasterPage.Master" AutoEventWireup="true" CodeBehind="ListContacts.aspx.cs" Inherits="GRC_TPE_WebApp.View.Private.Client.ListContacts" %>
<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <fieldset>
        <legend>Filtres</legend>
        Laissez les champs vide pour ne pas filtrer
        <table class="contentTable">
            <tr>
                <td class="td_left">Nom:</td>
                <td><asp:TextBox ID="TB_FilterNom" runat="server" Width="220px"></asp:TextBox></td>
            </tr>
            <tr>
                <td class="td_left">Fonction:</td>
                <td><asp:TextBox ID="TB_FilterFonction" runat="server" Width="220px"></asp:TextBox></td>
            </tr>
            <tr>
                <td class="td_left">Client:</td>
                <td><asp:TextBox ID="TB_FilterClient" runat="server" Width="220px"></asp:TextBox></td>
            </tr>
            <tr>
                <td class="td_left"></td>
                <td></td>
            </tr>
            <tr>
                <td></td>
                <td><asp:Button ID="B_Filter" runat="server" Text="Filtrer" 
                        onclick="B_Filter_Click" /></td>
                <td></td>
                <td><asp:Button ID="B_Clear" runat="server" Text="Réinitialiser" 
                        onclick="B_Clear_Click" /></td>
            </tr>
        </table>
    </fieldset>
    <asp:ListView ID="LV_Contact" runat="server" DataKeyNames="Id" 
        DataSourceID="DS_Contacts" GroupItemCount="1">
        <AlternatingItemTemplate>
            <td runat="server" style="background-color:#d4e3f3;">
                <table class="contentTable">
                    <tr>
                        <td class="td_left">Prénom:</td>
                        <td><asp:Label ID="FirstnameLabel" runat="server" Text='<%# Eval("Firstname") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Nom:</td>
                        <td><asp:Label ID="LastnameLabel" runat="server" Text='<%# Eval("Lastname") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Téléphone:</td>
                        <td><asp:Label ID="Label1" runat="server" Text='<%# Eval("Phone") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Email:</td>
                        <td><asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Fonction:</td>
                        <td><asp:Label ID="FunctionLabel" runat="server" Text='<%# Eval("Function") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Client:</td>
                        <td><asp:Label ID="ClientLabel" runat="server" Text='<%# Eval("Client.Name") %>' /></td>
                    </tr>
                    <tr>
                        <td><asp:Button ID="B_Delete" runat="server" Text="Supprimer" onclick="B_Delete_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                        <td><asp:Button class="Update_button" runat="server" Text="Modifier" onclick="Update_button_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                    </tr>
                </table>
            </td>
        </AlternatingItemTemplate>
        <EmptyDataTemplate>
            <table class="contentTable" runat="server" 
                style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                <tr>
                    <td>
                        Aucun contact en base.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EmptyItemTemplate>
            <td runat="server" />
        </EmptyItemTemplate>
        <GroupTemplate>
            <tr ID="itemPlaceholderContainer" runat="server">
                <td ID="itemPlaceholder" runat="server">
                </td>
            </tr>
        </GroupTemplate>
        <ItemTemplate>
            <td runat="server" style="background-color:#eaf3f9;color: #000000;">
                <table class="contentTable">
                    <tr>
                        <td class="td_left">Prénom:</td>
                        <td><asp:Label ID="FirstnameLabel" runat="server" Text='<%# Eval("Firstname") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Nom:</td>
                        <td><asp:Label ID="LastnameLabel" runat="server" Text='<%# Eval("Lastname") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Téléphone:</td>
                        <td><asp:Label ID="Label1" runat="server" Text='<%# Eval("Phone") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Email:</td>
                        <td><asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Fonction:</td>
                        <td><asp:Label ID="FunctionLabel" runat="server" Text='<%# Eval("Function") %>' /></td>
                    </tr>
                    <tr>
                        <td class="td_left">Client:</td>
                        <td><asp:Label ID="ClientLabel" runat="server" Text='<%# Eval("Client.Name") %>' /></td>
                    </tr>
                    <tr>
                        <td><asp:Button ID="B_Delete" runat="server" Text="Supprimer" onclick="B_Delete_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                        <td><asp:Button ID="Button1" class="Update_button" runat="server" Text="Modifier" onclick="Update_button_Click" CommandArgument='<%# Eval("Id") %>' /></td>
                    </tr>
                </table>
            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server" class="contentTable">
                <tr runat="server">
                    <td runat="server">
                        <table class="contentTable" ID="groupPlaceholderContainer" runat="server" border="1" 
                            style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <tr ID="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" 
                        style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                        <asp:DataPager ID="DataPager1" runat="server" PageSize="12">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowLastPageButton="True" FirstPageText="Premier" LastPageText="Dernier" NextPageText="Suivant" PreviousPageText="Précédent" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
    </asp:ListView>
    <asp:EntityDataSource ID="DS_Contacts" runat="server" 
        ConnectionString="name=Model_GRC_TPEContainer" 
        DefaultContainerName="Model_GRC_TPEContainer" EntitySetName="ContactSet" 
        EntityTypeFilter="Contact" Include="Client">
    </asp:EntityDataSource>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="footer" runat="server">
</asp:Content>